package com.community.auth.feign.factory;

import com.community.auth.feign.ManageRemote;
import com.community.common.entity.vo.UserLoginVo;
import com.community.common.result.Result;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ManageRmoteFactory implements FallbackFactory<ManageRemote> {

    @Override
    public ManageRemote create(Throwable cause) {
        return new ManageRemote(){
            @Override
            public Result<UserLoginVo> findUserByPhone(String phone) {
                return Result.error("网络故障");
            }
        };
    }
}
